home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Developer Toolbox 6.1
/
SGI Developer Toolbox 6.1 - Disc 4.iso
/
src
/
swtools
/
trubasic
/
rolldemos
/
chooser
/
tbmenu.tru
< prev
next >
Wrap
Text File
|
1994-08-02
|
2KB
|
72 lines
external
! main menu loop for tb demos
module tb
DECLARE PUBLIC tbpts(,),tbtxt$()
sub tb_demos
call draw_tb
call waitup
do
call getclick_tb(op)
if op=1 then
chain "!cd ../demos/tb;../../basic/tru -i barchart.tru &",return
elseif op=2 then
chain "!cd ../demos/tb;../../basic/tru -i bounce.tru &",return
elseif op=3 then
chain "!cd ../demos/tb;../../basic/tru -i hanoi.tru &",return
elseif op=4 then
chain "!cd ../demos/tb;../../basic/tru -i abouttb.tru &",return
elseif op=5 then
chain "!cd ../demos/tb;../../basic/tru -i hilbert.tru &",return
elseif op=6 then
chain "!cd ../demos/tb;../../basic/tru -i lissa.tru &",return
elseif op=7 then
chain "!cd ../demos/tb;../../basic/tru -i spiro.tru &",return
elseif op=0 then
exit sub
end if
if op<>0 and op<>-1 then
call expand(tbpts(op,1),tbpts(op,2),tbpts(op,3),tbpts(op,4))
draw textbox(tbpts(op,1),tbpts(op,2),tbpts(op,3),tbpts(op,4),tbtxt$(op))
call waitup
pause 3
call unexpand(tbpts(op,1),tbpts(op,2),tbpts(op,3),tbpts(op,4))
draw textbox(tbpts(op,1),tbpts(op,2),tbpts(op,3),tbpts(op,4),tbtxt$(op))
end if
if refresh(1)=1 then
call draw_tb
end if
loop
end sub
sub draw_tb
let u=ubound(tbpts,1)
clear
for i=1 to u
draw tbbox(i)
next i
box keep 0,1,0,1 in tbbox$
end sub
picture tbbox(op)
draw box(tbpts(op,1),tbpts(op,2),tbpts(op,3),tbpts(op,4),op)
draw textbox(tbpts(op,1),tbpts(op,2),tbpts(op,3),tbpts(op,4),tbtxt$(op))
end picture
sub getclick_tb(op)
get mouse x,y,state
let op=-1
if state<>0 and x>=0 and x<=1 and y>=0 and y<=1 then
let u=ubound(tbpts,1)
let op=0
for i=1 to u
if x>tbpts(i,1) and x<tbpts(i,2) and y>tbpts(i,3) and y<tbpts(i,4) then
let op=i
exit sub
end if
next i
end if
end sub
end module